home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / vc / pro15 / examples.prg < prev    next >
Text File  |  1993-04-15  |  27KB  |  683 lines

  1. *  ┌───────────────────────────────────────────────────────────────────────┐
  2. * ▌│                                                                       │
  3. * ▌│   Function: makewpc()                                                 │
  4. * ▌│   Purpose : WordPerfect codes added or removed                        │
  5. * ▌│   Usage   :                                                           │
  6. * ▌│                                                                       │
  7. * ▌│   Program : docMakkr(tm) examples                                     │
  8. * ▌│   Author  : Copyright (C) 1992, LumiNet Publishing Corporation        │
  9. * ▌│                                 All Rights Reserved.                  │
  10. * ▌│                                                                       │
  11. * ▌│   Comments: Required linked libraries include:                        │
  12. * ▌│                SUPER5.LIB                                             │
  13. * ▌│                CLP2WPC.LIB                                            │
  14. * ▌│                FUNCKY50.LIB                                           │
  15. * ▌│                                                                       │
  16. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  17. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  18.  
  19. *-------------------------------------------------------------------------*
  20. * Function to text salutation for determining if hard returns are
  21. * required  (sort of limited scope here - idea is to get something
  22. * up and running)
  23. *-------------------------------------------------------------------------*
  24. Function Make_WPC_line
  25. parameters textline, sr
  26. ** variable sr will be 'S'-Strip out code or 'R'-Replace with WPC code
  27. private extra_large, very_large, large, small, fine, superscript
  28. private subscript, outline, italics, shadow, redline, dbl_under, bold
  29. private strike_out, underline, small_caps
  30. private maxcode
  31. private wpccount, newline
  32. private leftmark, rightmark, badline, thecode, firsthalf, lasthalf
  33. maxcode=53
  34. private wpccode[maxcode]
  35. *-------------------------------------------------------------------------*
  36. * WPC Attribute values                               
  37. *-------------------------------------------------------------------------*
  38. Extra_large=    0 
  39. Very_large =    1 
  40. Large      =    2 
  41. Small      =    3
  42. Fine       =    4 
  43. Superscript=    5 
  44. Subscript  =    6 
  45. Outline    =    7 
  46. Italics    =    8 
  47. Shadow     =    9 
  48. Redline    =   10
  49. Dbl_under  =   11
  50. Bold       =   12
  51. Strike_out =   13
  52. Underline  =   14
  53. Small_caps =   15
  54.  
  55. *-------------------------------------------------------------------------*
  56. * WPC Blitzen(tm)   codes                            
  57. *-------------------------------------------------------------------------*
  58. wpccode[1]  ="LRMARG|"
  59. wpccode[2]  ="TBMARG|"
  60. wpccode[3]  ="PAGENO|"
  61. wpccode[4]  ="JUST|"
  62. wpccode[5]  ="HOR|"
  63. wpccode[6]  ="VER|"
  64. wpccode[7]  ="BOLD|ON"
  65. wpccode[8]  ="BOLD|OFF"
  66. wpccode[9]  ="CENTER"
  67. wpccode[10] ="DBLUND|ON"
  68. wpccode[11] ="DBLUND|OFF"
  69. wpccode[12] ="EXLRG|ON"
  70. wpccode[13] ="EXLRG|OFF"
  71. wpccode[14] ="FINE|ON"
  72. wpccode[15] ="FINE|OFF"
  73. wpccode[16] ="HARDPAGE|"
  74. wpccode[17] ="HR|"
  75. wpccode[18] ="INDENT|"
  76. wpccode[19] ="ITALIC|ON"
  77. wpccode[20] ="ITALIC|OFF"
  78. wpccode[21] ="LARGE|ON"
  79. wpccode[22] ="LARGE|OFF"
  80. wpccode[23] ="OUTLN|ON"
  81. wpccode[24] ="OUTLN|OFF"
  82. wpccode[25] ="REDLN|ON"
  83. wpccode[26] ="REDLN|OFF"
  84. wpccode[27] ="SHAD|ON"
  85. wpccode[28] ="SHAD|OFF"
  86. wpccode[29] ="SMALL|ON"
  87. wpccode[30] ="SMALL|OFF"
  88. wpccode[31] ="SMCAP|ON"
  89. wpccode[32] ="SMCAP|OFF"
  90. wpccode[33] ="SOFT|ON"
  91. wpccode[34] ="SOFT|OFF"
  92. wpccode[35] ="SUBSC|ON"
  93. wpccode[36] ="SUBSC|OFF"
  94. wpccode[37] ="SUPSC|ON"
  95. wpccode[38] ="SUPSC|OFF"
  96. wpccode[39] ="TAB|"
  97. wpccode[40] ="UNDLN|ON"
  98. wpccode[41] ="UNDLN|OFF"
  99. wpccode[42] ="SDATE|"
  100. wpccode[43] ="VLARGE|ON"
  101. wpccode[44] ="VLARGE|OFF"
  102. wpccode[45] ="STRIKE|ON"
  103. wpccode[46] ="STRIKE|OFF"
  104. wpccode[47] ="NEWCOL|ON"
  105. wpccode[48] ="NEWCOL|OFF"
  106. wpccode[49] ="H/FSTART|"
  107. wpccode[50] ="H/FEND|"
  108. wpccode[51] ="SETTAB|"
  109. wpccode[52] ="FIGGR|"
  110. wpccode[53] ="FNTCHG|"
  111.  
  112.  
  113. *-------------------------------------------------------------------------*
  114. * Find all of the WPC codes in the string of text, and convert into
  115. * the appropriate docMakkr(tm) calls
  116. * Depending on the value of the memory variable 'sr':
  117. *     = 'R'....indicates that a WordPerfect document is to be created -
  118. *              thereby replacing all WordPerfect formatting codes with
  119. *              their equivalent from the docMakkr toolkit library.
  120. *
  121. *     = 'S'....indicates that a text or print file is to be created -
  122. *              thereby stripping out all WordPerfect formatting codes
  123. * Searches for the occurrence of CHR(204) and CHR(185) pair.  This pair
  124. * will indicate that a WordPerfect code has been found within the text
  125. * string.
  126. *-------------------------------------------------------------------------*
  127. leftmark = AT(CHR(204), textline)
  128. badline=.F.
  129. wpccount=0
  130. thecode=""
  131. firsthalf=""
  132. lasthalf=""
  133.  
  134. newline=""
  135. If !Empty(textline)
  136.     textline = STRTRAN(textline,CHR(141))+" "
  137.     textline = STRTRAN(textline,CHR(9))+""
  138. Endif
  139.  
  140. If leftmark = 0
  141.     If sr = "R"
  142.         WpAdd(textline)
  143.     Endif
  144. Else
  145.     DO WHILE leftmark != 0 .AND. !badline
  146.         rightmark = AT(CHR(185), textline)
  147.         IF rightmark = 0
  148.               badline = .T.
  149.               If sr = "R"
  150.                   WpAdd(textline)
  151.               Endif
  152.             Exit
  153.         ELSE
  154.               *- extract the item between the delimiters
  155.               thecode = SUBSTR(textline, leftmark + 1,rightmark - leftmark - 1)
  156.               IF !EMPTY(thecode)
  157.                 firsthalf = SUBSTR(textline, 1, leftmark - 1)
  158.                 lasthalf  = SUBSTR(textline, rightmark + 1)
  159.                 newline = firsthalf+lasthalf
  160.                 If sr = "R"
  161.                     WpAdd(firsthalf)
  162.                     *-- make sure it's a valid WPC Blitzen(tm) code --*
  163.                     for wpccount = 1 to maxcode
  164.                         If wpccode[wpccount] $ thecode
  165.                             Parse_Code(thecode)
  166.                         Endif
  167.                     next
  168.                     textline=lasthalf
  169.                 Else
  170.                     textline=newline
  171.                 Endif
  172.               ENDIF
  173.               leftmark = AT(CHR(204), textline)
  174.             If leftmark = 0
  175.                 If sr = "R"
  176.                     WpAdd(textline)
  177.                 Endif
  178.                 Exit
  179.             Endif
  180.            ENDIF
  181.     ENDDO    
  182. Endif
  183.  
  184. If sr = "S"
  185.     ?textline
  186. Else
  187.     If !softon
  188.         WpHRTN(1)
  189.     Endif
  190. Endif
  191. Return(.T.)
  192.  
  193.  
  194. *  ┌───────────────────────────────────────────────────────────────────────┐
  195. * ▌│                                                                       │
  196. * ▌│   Function: parse_code()                                              │
  197. * ▌│   Purpose : WordPerfect codes added                                   │
  198. * ▌│   Usage   :                                                           │
  199. * ▌│                                                                       │
  200. * ▌│   Author  : Copyright (C) 1992, LumiNet Publishing Corporation        │
  201. * ▌│                                 All Rights Reserved.                  │
  202. * ▌│                                                                       │
  203. * ▌│   Comments: Required linked libraries include:                        │
  204. * ▌│                SUPER5.LIB                                             │
  205. * ▌│                CLP2WPC.LIB                                            │
  206. * ▌│                FUNCKY50.LIB                                           │
  207. * ▌│                                                                       │
  208. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  209. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  210. *-------------------------------------------------------------------------*
  211. * Translate the WPC code                
  212. * Objective........Convert the WordPerfect text & document formatting
  213. *                  codes that appear in a memo field into their actual
  214. *                  WordPerfect equivalent.
  215. * Arguments........The entire code value is passed, which includes user
  216. *                  defined paramaters, such as # of inches within a
  217. *                  left and right margin. 
  218. * Returns..........nothing
  219. * Translation......Uses the docMakkr(tm) toolkit library of routines to
  220. *                  transform user formatting requests into a 
  221. *                  WordPerfect compatable document.
  222. *-------------------------------------------------------------------------*
  223.  
  224.  
  225. Function Parse_code
  226. Parameters codefound
  227.  
  228. private mark, wpcval, wpcval2, wpcval3, wpcval4, comma
  229.  
  230.  
  231. DO CASE
  232.  
  233. *  ┌───────────────────────────────────────────────────────────────────────┐
  234. * ▌│ Left / Right Margins                                                  │
  235. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  236. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  237.     CASE "LRMARG|" $ codefound  
  238.         mark = AT("|", codefound)
  239.         If mark > 0
  240.             comma = AT(",", codefound)
  241.             If comma > 0
  242.                 wpcval = VAL(Substr(codefound, mark + 1, comma - mark - 1)) * 1200
  243.                 wpcval2 = VAL(Substr(codefound, comma + 1)) * 1200
  244.                 If wpcval > 0 .and. wpcval2 > 0
  245.                     WpLRMarg(wpcval, wpcval2)        
  246.                 Endif
  247.             Endif
  248.         Endif
  249.     
  250. *  ┌───────────────────────────────────────────────────────────────────────┐
  251. * ▌│ Top / Bottom Margins                                                  │
  252. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  253. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  254.     CASE "TBMARG|" $ codefound  
  255.         mark = AT("|", codefound)
  256.         If mark > 0
  257.             comma = AT(",", codefound)
  258.             If comma > 0
  259.                 wpcval = VAL(Substr(codefound, mark + 1, comma - mark - 1)) * 1200
  260.                 wpcval2 = VAL(Substr(codefound, comma + 1)) * 1200
  261.                 If wpcval > 0 .and. wpcval2 > 0
  262.                     WpTBMarg(wpcval, wpcval2)        
  263.                 Endif
  264.             Endif
  265.         Endif
  266.     
  267. *  ┌───────────────────────────────────────────────────────────────────────┐
  268. * ▌│ Page Numbering Position                                               │
  269. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  270. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  271.     CASE "PAGENO|" $ codefound  
  272.         mark = AT("|", codefound)
  273.         If mark > 0
  274.             mark=mark+1
  275.             wpcval  = VAL(Alltrim(SUBSTR(codefound, mark)))
  276.             If wpcval > 0
  277.                 WpHPAGE(wpcval)
  278.             Endif
  279.         Endif
  280.     
  281. *  ┌───────────────────────────────────────────────────────────────────────┐
  282. * ▌│ Justification                                                         │
  283. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  284. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  285.     CASE "JUST|"   $ codefound  
  286.         mark = AT("|", codefound)
  287.         If mark > 0
  288.             mark=mark+1
  289.             wpcval  = VAL(Alltrim(SUBSTR(codefound, mark)))
  290.             If wpcval > 0
  291.                 WpJUST(wpcval)
  292.             Endif
  293.         Endif
  294.  
  295. *  ┌───────────────────────────────────────────────────────────────────────┐
  296. * ▌│ Horizontal Line                                                       │
  297. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  298. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  299.     CASE "HOR|"    $ codefound   
  300.         mark = AT("|", codefound)
  301.         If mark > 0
  302.             commafir = 0
  303.             commasec = ATNEXT(",", codefound,1)
  304.             If commasec > 0
  305.                 wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1)) 
  306.                 wpcval2 = VAL(Substr(codefound, commasec+1,1)) 
  307.                 wpcval3 = VAL(Substr(codefound, AtNext(",", codefound,2)+1,1)) 
  308.                 wpcval4 = VAL(Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1)) 
  309.                 wpcval5 = VAL(Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1)) 
  310.                 wpcval6 = VAL(Substr(codefound, AtNext(",", codefound,5)+1)) 
  311.                 WpHLine(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6)        
  312.             Endif
  313.         Endif
  314.  
  315.  
  316. *  ┌───────────────────────────────────────────────────────────────────────┐
  317. * ▌│ Vertical Line                                                         │
  318. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  319. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  320.     CASE "VER|"    $ codefound  
  321.         mark = AT("|", codefound)
  322.         If mark > 0
  323.             commafir = 0
  324.             commasec = ATNEXT(",", codefound,1)
  325.             If commasec > 0
  326.                 wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1)) 
  327.                 wpcval2 = VAL(Substr(codefound, commasec+1,1)) 
  328.                 wpcval3 = VAL(Substr(codefound, AtNext(",", codefound,2)+1,1)) 
  329.                 wpcval4 = VAL(Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1)) 
  330.                 wpcval5 = VAL(Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1)) 
  331.                 wpcval6 = VAL(Substr(codefound, AtNext(",", codefound,5)+1)) 
  332.                 WpVLine(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6)        
  333.             Endif
  334.         Endif
  335.  
  336. *  ┌───────────────────────────────────────────────────────────────────────┐
  337. * ▌│ Bold  (On)  (Off)                                                     │
  338. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  339. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  340.     CASE "BOLD|ON" $ codefound  
  341.         WpAttOn(Bold)
  342.  
  343.     CASE "BOLD|OFF" $ codefound 
  344.         WpAttOff(Bold)
  345.  
  346. *  ┌───────────────────────────────────────────────────────────────────────┐
  347. * ▌│ Line Centering                                                        │
  348. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  349. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  350.     CASE "CENTER" $ codefound
  351.         WpCntr()
  352.  
  353. *  ┌───────────────────────────────────────────────────────────────────────┐
  354. * ▌│ Double Underline  (On)  (Off)                                         │
  355. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  356. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  357.     CASE "DBLUND|ON" $ codefound 
  358.         WpAttOn(Dbl_under)
  359.         
  360.     CASE "DBLUND|OFF" $ codefound 
  361.         WpAttOff(Dbl_under)
  362.  
  363. *  ┌───────────────────────────────────────────────────────────────────────┐
  364. * ▌│ Strikeout   (On)  (Off)                                               │
  365. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  366. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  367.     CASE "STRIKE|ON" $ codefound 
  368.         WpAttOn(Strike_out)
  369.         
  370.     CASE "STRIKE|OFF" $ codefound 
  371.         WpAttOff(Strike_out)
  372.         
  373. *  ┌───────────────────────────────────────────────────────────────────────┐
  374. * ▌│ Extra Large   (On)   (Off)                                            │
  375. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  376. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  377.     CASE "EXLRG|ON" $ codefound 
  378.         WpAttOn(Extra_large)
  379.  
  380.     CASE "EXLRG|OFF" $ codefound 
  381.         WpattOff(Extra_large)
  382.  
  383. *  ┌───────────────────────────────────────────────────────────────────────┐
  384. * ▌│ Very Large   (On)   (Off)                                             │
  385. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  386. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  387.     CASE "VLARGE|ON" $ codefound 
  388.         WpAttOn(Very_large)
  389.  
  390.     CASE "VLARGE|OFF" $ codefound 
  391.         WpattOff(Very_large)
  392.  
  393. *  ┌───────────────────────────────────────────────────────────────────────┐
  394. * ▌│ Fine  (On)  (Off)                                                     │
  395. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  396. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  397.     CASE "FINE|ON" $ codefound 
  398.         WpattOn(Fine)
  399.  
  400.     CASE "FINE|OFF" $ codefound 
  401.         WpattOff(Fine)
  402.  
  403. *  ┌───────────────────────────────────────────────────────────────────────┐
  404. * ▌│ Hard Page Return                                                      │
  405. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  406. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  407.     CASE "HARDPAGE|" $ codefound 
  408.         mark = AT("|", codefound)
  409.         If mark > 0
  410.             mark=mark+1
  411.             wpcval  = VAL(Alltrim(SUBSTR(codefound, mark)))
  412.             If wpcval > 0
  413.                 WpHPAGE(wpcval)
  414.             Endif
  415.         Endif
  416.  
  417. *  ┌───────────────────────────────────────────────────────────────────────┐
  418. * ▌│ Hard Line Return                                                      │
  419. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  420. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  421.     CASE "HR|" $ codefound 
  422.         mark = AT("|", codefound)
  423.         If mark > 0
  424.             mark=mark+1
  425.             wpcval  = VAL(Alltrim(SUBSTR(codefound, mark)))
  426.             If wpcval > 0
  427.                 WpHRTN(wpcval)
  428.             Endif
  429.         Endif
  430.                     
  431.  
  432. *  ┌───────────────────────────────────────────────────────────────────────┐
  433. * ▌│ Indent                                                                │
  434. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  435. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  436.     CASE "INDENT|" $ codefound 
  437.         mark = AT("|", codefound)
  438.         If mark > 0
  439.             mark=mark+1
  440.             wpcval  = VAL(Alltrim(SUBSTR(codefound, mark)))
  441.             If wpcval > 0
  442.                 WpINDENT(wpcval)
  443.             Endif
  444.         Endif
  445.  
  446. *  ┌───────────────────────────────────────────────────────────────────────┐
  447. * ▌│ Italics   (On)   (Off)                                                │
  448. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  449. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  450.     CASE "ITALIC|ON" $ codefound 
  451.         WpAttOn(Italics)
  452.  
  453.     CASE "ITALIC|OFF" $ codefound 
  454.         WpAttOff(Italics)
  455.  
  456. *  ┌───────────────────────────────────────────────────────────────────────┐
  457. * ▌│ Large (On)  (Off)                                                     │
  458. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  459. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  460.     CASE "LARGE|ON" $ codefound 
  461.         WpAttOn(Large)
  462.  
  463.     CASE "LARGE|OFF" $ codefound 
  464.         WpAttOff(Large)
  465.  
  466. *  ┌───────────────────────────────────────────────────────────────────────┐
  467. * ▌│ Outline   (On)   (Off)                                                │
  468. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  469. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  470.     CASE "OUTLN|ON" $ codefound 
  471.         WpAttOn(Outline)
  472.  
  473.     CASE "OUTLN|OFF" $ codefound 
  474.         WpAttOff(Outline)
  475.  
  476. *  ┌───────────────────────────────────────────────────────────────────────┐
  477. * ▌│ Redline   (On)    (Off)                                               │
  478. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  479. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  480.     CASE "REDLN|ON" $ codefound 
  481.         WpAttOn(Redline)
  482.  
  483.     CASE "REDLN|OFF" $ codefound 
  484.         WpAttOff(Redline)
  485.  
  486. *  ┌───────────────────────────────────────────────────────────────────────┐
  487. * ▌│ Shadow   (On)    (Off)                                                │
  488. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  489. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  490.     CASE "SHAD|ON" $ codefound 
  491.         WpAttOn(Shadow)
  492.  
  493.     CASE "SHAD|OFF" $ codefound 
  494.         WpAttOff(Shadow)
  495.  
  496. *  ┌───────────────────────────────────────────────────────────────────────┐
  497. * ▌│ Small (On)  (Off)                                                     │
  498. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  499. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  500.     CASE "SMALL|ON" $ codefound 
  501.         WpAttOn(Small)
  502.  
  503.     CASE "SMALL|OFF" $ codefound 
  504.         WpAttOff(Small)
  505.  
  506. *  ┌───────────────────────────────────────────────────────────────────────┐
  507. * ▌│ Small Caps  (On)   (Off)                                              │
  508. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  509. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  510.     CASE "SMCAP|ON" $ codefound 
  511.         WpAttOn(Small_caps)
  512.  
  513.     CASE "SMCAP|OFF" $ codefound 
  514.         WpAttOff(Small_caps)
  515.  
  516. *  ┌───────────────────────────────────────────────────────────────────────┐
  517. * ▌│ Soft Return  (On)   (Off)                                             │
  518. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  519. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  520.     CASE "SOFT|ON" $ codefound 
  521.         softon=.T.
  522.  
  523.     CASE "SOFT|OFF" $ codefound 
  524.         softon=.F.
  525.  
  526. *  ┌───────────────────────────────────────────────────────────────────────┐
  527. * ▌│ Subscript   (On)   (Off)                                              │
  528. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  529. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  530.     CASE "SUBSC|ON" $ codefound 
  531.         WpAttOn(Subscript)
  532.  
  533.     CASE "SUBSC|OFF" $ codefound 
  534.         WpAttOff(Subscript)
  535.         
  536. *  ┌───────────────────────────────────────────────────────────────────────┐
  537. * ▌│ Superscript  (On)   (Off)                                             │
  538. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  539. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  540.     CASE "SUPSC|ON" $ codefound 
  541.         WpAttOn(Superscript)
  542.  
  543.     CASE "SUPSC|OFF" $ codefound 
  544.         WpAttOff(Superscript)
  545.  
  546. *  ┌───────────────────────────────────────────────────────────────────────┐
  547. * ▌│ Underline   (On)   (Off)                                              │
  548. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  549. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  550.     CASE "UNDLN|ON" $ codefound 
  551.         WpAttOn(Underline)
  552.  
  553.     CASE "UNDLN|OFF" $ codefound 
  554.         WpAttOff(Underline)
  555.  
  556. *  ┌───────────────────────────────────────────────────────────────────────┐
  557. * ▌│ Tab                                                                   │
  558. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  559. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  560.     CASE "TAB|" $ codefound 
  561.         mark = AT("|", codefound)
  562.         If mark > 0
  563.             mark=mark+1
  564.             wpcval  = Max (VAL(Alltrim(SUBSTR(codefound, mark))), 1)
  565.             If wpcval > 0
  566.                 wptab(wpcval)
  567.             Endif
  568.         Endif
  569.  
  570. *  ┌───────────────────────────────────────────────────────────────────────┐
  571. * ▌│ System Date and Time                                                  │
  572. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  573. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  574.     CASE "SDATE|" $ codefound 
  575.         mark = AT("|", codefound)
  576.         If mark > 0
  577.             mark=mark+1
  578.             wpcval  = Alltrim(SUBSTR(codefound, mark))
  579.             If !Empty(wpcval)
  580.                 WpDATE(wpcval)
  581.             Endif
  582.         Endif
  583.  
  584. *  ┌───────────────────────────────────────────────────────────────────────┐
  585. * ▌│ Set Tabs (maximum of 6 settings)                                      │
  586. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  587. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  588.     CASE "SETTAB|" $ codefound  
  589.         mark = AT("|", codefound)
  590.         If mark > 0
  591.             commafir = 0
  592.             commasec = ATNEXT(",", codefound,1)
  593.             If commasec > 0
  594.                 wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1)) 
  595.                 wpcval2 = VAL(Substr(codefound, commasec+1,1)) 
  596.                 wpcval3 = VAL(Substr(codefound, AtNext(",", codefound,2)+1,1)) 
  597.                 wpcval4 = VAL(Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1)) 
  598.                 wpcval5 = VAL(Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1)) 
  599.                 wpcval6 = VAL(Substr(codefound, AtNext(",", codefound,5)+1, AtNext(",",codefound,6)-AtNext(",",codefound,5)-1)) 
  600.                 wpcval7 = VAL(Substr(codefound, AtNext(",", codefound,6)+1, AtNext(",",codefound,7)-AtNext(",",codefound,6)-1)) 
  601.                 wpcval8 = VAL(Substr(codefound, AtNext(",", codefound,7)+1, AtNext(",",codefound,8)-AtNext(",",codefound,7)-1)) 
  602.                 wpcval9 = VAL(Substr(codefound, AtNext(",", codefound,8)+1, AtNext(",",codefound,9)-AtNext(",",codefound,8)-1)) 
  603.                 wpcval0 = VAL(Substr(codefound, AtNext(",", codefound,9)+1)) 
  604.                 WpSetTab(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6, wpcval7, wpcval8, wpcval9, wpcval0)        
  605.             Endif
  606.         Endif
  607.  
  608.  
  609. *  ┌───────────────────────────────────────────────────────────────────────┐
  610. * ▌│ Figure Graphics                                                       │
  611. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  612. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  613.     CASE "FIGGR|" $ codefound  
  614.         mark = AT("|", codefound)
  615.         If mark > 0
  616.             commafir = 0
  617.             commasec = ATNEXT(",", codefound,1)
  618.             If commasec > 0
  619.                 wpcval1 =Substr(codefound, mark + 1, commasec - mark - 1)
  620.                 wpcval2 = Substr(codefound, commasec+1,1)
  621.                 wpcval2 = val(wpcval2)
  622.                 wpcval3 = Substr(codefound, AtNext(",", codefound,2)+1,1)
  623.                 wpcval3 = val(wpcval3)
  624.                 wpcval4 = Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1)
  625.                 wpcval4 = Val(wpcval4)
  626.                 wpcval5 = Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1)
  627.                 wpcval5 = val(wpcval5)
  628.                 wpcval6 = Substr(codefound, AtNext(",", codefound,5)+1)
  629.                 wpcval6 = val(wpcval6)
  630.                 WpFig(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6)        
  631.             Endif
  632.         Endif
  633.     
  634. *  ┌───────────────────────────────────────────────────────────────────────┐
  635. * ▌│ Newspaper Columns   (On)   (Off)                                      │
  636. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  637. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  638.     CASE "NEWCOL|ON" $ codefound 
  639.         WpClmOn()
  640.  
  641.     CASE "NEWCOL|OFF" $ codefound 
  642.         WpClmOff()
  643.  
  644.  
  645. *  ┌───────────────────────────────────────────────────────────────────────┐
  646. * ▌│ Font change                                                           │
  647. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  648. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  649.     CASE "FNTCHG|" $ codefound 
  650.         mark = AT("|", codefound)
  651.         If mark > 0
  652.             mark=mark+1
  653.             wpcval  = Max (VAL(Alltrim(SUBSTR(codefound, mark))), 1)
  654.             If wpcval > 0
  655.                 wpfont(wpcval)
  656.             Endif
  657.         Endif
  658.  
  659.  
  660. *  ┌───────────────────────────────────────────────────────────────────────┐
  661. * ▌│ Header A/B Footer A/B  (On)   (Off)                                   │
  662. * ▌└───────────────────────────────────────────────────────────────────────┘ 
  663. * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  664.     CASE "H/FSTART|" $ codefound 
  665.         mark = AT("|", codefound)
  666.         If mark > 0
  667.             commafir = 0
  668.             commasec = ATNEXT(",", codefound,1)
  669.             If commasec > 0
  670.                 wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1)) 
  671.                 wpcval2 = VAL(Substr(codefound, commasec+1,1)) 
  672.                 Wphfstrt(wpcval1, wpcval2)        
  673.             Endif
  674.         Endif
  675.  
  676.     CASE "H/FEND|" $ codefound 
  677.         WpHfend()
  678.  
  679.     
  680. ENDCASE
  681.  
  682. Return(.t.)
  683.